package com.crm.service.crm.businessOpportunities.controller;


import com.crm.model.common.dtos.ResponseResult;
import com.crm.model.crm.businessOpportunities.dto.CustomInfoDto;
import com.crm.model.crm.businessOpportunities.dto.CustomInfoPageDto;
import com.crm.service.crm.businessOpportunities.service.CustomInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/business_opportunity")
@Slf4j
public class CustomInfoController {
    @Autowired
    private CustomInfoService customInfoService;

    @PostMapping("/save")
    public ResponseResult add(@RequestBody CustomInfoDto customInfoDto){
        log.info("前端数据："+customInfoDto.toString());
        ResponseResult add = customInfoService.add(customInfoDto);
        return add;
    }

    @PostMapping("/list")
    public ResponseResult getAll(@RequestBody CustomInfoPageDto customInfoPageDto){
        ResponseResult all = customInfoService.getAll(customInfoPageDto);
        return all;
    }
}
